package router

import (
	"github.com/gin-gonic/gin"
	"github.com/ruibin/gin01/service"
)

func Router() *gin.Engine {
	var r = gin.Default()
	var ir = r.Group("/api")

	// 用户管理
	var user = ir.Group("/user")
	user.GET("/list", service.UserController.List)
	user.GET("/:id", service.UserController.Detail)

	// 文章管理
	var article = ir.Group("/article")
	article.GET("/list", service.Article)

	return r
}
